#include <iostream>
#include <string>
#include <string_view>
#include <fmt/format.h>
using namespace std;

int main()
{

    std::string s1{"red"};
    std::string s2{s1};
    std::string_view v1{s1};

    std::cout << fmt::format("s1:{}  s2:{}  v1:{}\n", s1, s2, v1);

    s1.at(0) = 'R';
    std::cout << fmt::format("s1:{}  s2:{}  v1:{}\n", s1, s2, v1);

    std::cout << fmt::format("s1 == v1:{}  s2==v1:{} \n", s1 == v1, s2 == v1);

    // Remove characters of specified length
    v1.remove_prefix(1);
    v1.remove_suffix(1);
    std::cout << fmt::format("s1:{}  v1:{}\n", s1, v1);

    for (char c : s2)
    {
        std::cout << c << " ";
    }
    std::cout << "\n";
    std::string_view v2 = {"C-String"};
    std::cout << fmt::format("v2.size():{}\n", v2.size());
    std::cout << fmt::format("v2.find('-'):{}\n", v2.find('-'));
    std::cout << fmt::format("v2.starts_with('C'):{}\n", v2.starts_with('C'));
    return 0;
}
